﻿using System;
using EzDesk.Apps.Interface.ProjectModule;
using EzDesk.Apps.ServiceImpl.ProjectModule;
using EzDesk.Utility.TimerService;

namespace EzDesk.ServiceHost.TimerTask
{
    public class DailyWorkBlogTask:EverydayTimerTask
    {
        private readonly IProjectService _projectService = new ProjectService();
        IProjectService ProjectService
        {
            get { return _projectService; }
        }
        public DailyWorkBlogTask()
            : base("DailyWorkBlogTask", TimeSpan.FromHours(23))
        {

        }
        protected sealed override void doExecute()
        {
            ProjectService.SendDailyWorkBlog();
        }
    }
    public class WorkitemExpiredTask :  EverydayTimerTask
    {
        private readonly IProjectService _projectService = new ProjectService();
        IProjectService ProjectService
        {
            get { return _projectService; }
        }
        public WorkitemExpiredTask()
            : base("WorkitemExpiredTask", TimeSpan.FromHours(0))
        {

        }
        protected sealed override void doExecute()
        {
            ProjectService.CheckTimeoutWorkItems();
        }
    }
}
